package daytwo.数组;

import java.util.Scanner;

public class pra1 {
    public static void main(String[] args) {
        System.out.println("请输入学生数量");
        Scanner scanner = new Scanner(System.in);
        int number = scanner.nextInt();
        int maxscore = 0;
        int[] scores = new int[number];
        System.out.println("请输入每个学生的成绩");
        for (int i = 0; i < number; i++) {
            scores[i] = scanner.nextInt();
            if (scores[i] > maxscore) {
                maxscore = scores[i];
            }
        }
        System.out.println("最高成绩是" + maxscore);
        char grade = ' ';
        for (int i = 0; i < number; i++) {
            if (scores[i] >= maxscore - 10) {
                grade = 'A';
            } else if (scores[i] >= maxscore - 20) {
                grade = 'B';
            } else if (scores[i] >= maxscore - 30) {
                grade = 'C';
            } else {
                grade = 'D';
            }
            System.out.println("学生" + (i + 1) + "成绩是" + scores[i] + "等级是" + grade);
        }
    }
}
